#设置cmake最低版本
cmake_minimum_required(VERSION 3.4.1)

#设置项目名称
project(tst_qtquickcontrols2_auto)

#引入add_module模板文件
include(${ISSQTTESTROOTDIR}/cmake/add_module.cmake)

#设置测试类型，auto为自动测试，manual为手动测试,即test目录下的文件夹名
set(TEST_TYPE auto)
#设置模块名
set(MODULE qtquickcontrols2)
#设置需要链接的模块
set(LinkQt Core Gui Qml Quick QuickTest Widgets QuickControls2 QuickTemplates2 QmlWorkerScript OpenGL)
#设置需要链接的模块的私有模块
set(LinkQtPrivate Core Gui Qml Quick QuickControls2 QuickTemplates2 Test OpenGL)

set(CodeRootPath ${ISSQTTESTROOTDIR}/qtquickcontrols2)
include_directories(${CodeRootPath}/tests/auto/shared)

set(TST_CONTROLS_DATA "${QQC2_SOURCE_TREE}/tests/auto/controls/data")
add_definitions(-DTST_CONTROLS_DATA="${TST_CONTROLS_DATA}")
set(QQC2_SNIPPETS_PATH "${QQC2_SOURCE_TREE}/src/imports/controls/doc/snippets")
add_definitions(-DQQC2_SNIPPETS_PATH="${QQC2_SNIPPETS_PATH}")
set(QQC2_IMPORT_PATH "${QQC2_SOURCE_TREE}/src/imports")
add_definitions(-DQQC2_IMPORT_PATH="${QQC2_IMPORT_PATH}")
set(QT_QMLTEST_DATADIR "${CMAKE_CURRENT_SOURCE_DIR}/data")
add_definitions(-DQT_QMLTEST_DATADIR="${QT_QMLTEST_DATADIR}")

set(TEST_ITEMS ${TEST_ITEMS}
    accessibility
    cursor
    customization
    designer
    focus
    font
    palette
    pressandhold
    qquickapplicationwindow
    qquickdrawer
    qquickiconlabel
    qquickmaterialstyleconf
    qquickmenubar
    qquickninepatchimage
    qquickpopup
    qquickstyle
    qquickstyleselector
    qquickuniversalstyleconf
    revisions
    sanity
    snippets
    calendar
    platform
    qquickcolor
    qquickimaginestyle
    qquickmaterialstyle
    qquickuniversalstyle
    shared
)

#排出不需要的.cpp
set(EXCLUDE_SRC ${EXCLUDE_SRC}
    #SIGABRT(SI_TKILL)(Failed to create OpenGL context for format QSurfaceFormat)
    qquickpopup/tst_qquickpopup.cpp
    cursor/tst_cursor.cpp
    font/tst_font.cpp
    palette/tst_palette.cpp
    qquickiconlabel/tst_qquickiconlabel.cpp
    qquickmaterialstyleconf/tst_qquickmaterialstyleconf.cpp
    qquickmenubar/tst_qquickmenubar.cpp
    qquickninepatchimage/tst_qquickninepatchimage.cpp
    qquickdrawer/tst_qquickdrawer.cpp
    qquickapplicationwindow/tst_qquickapplicationwindow.cpp
    focus/tst_focus.cpp
)

set(PLUGINS QOpenHarmonyPlatformIntegrationPlugin)
create_library(${TEST_ITEMS})

